part 3

ba_compare

include bigatom.e 
namespace bigatom 
export function ba_compare(bigatom A, bigatom B) 

Compara dos bigatoms (NO_VALUE es menor que cualquier n?mero)

Comments:

Compares two bigatoms - (NO_VALUE is smaller than any number)

FUNCIONES DE SALIDA \\ OUTPUT FUNCTIONS

ba_sprint

include bigatom.e 
namespace bigatom 
export function ba_sprint(bigatom N) 

Devuelve la representaci?n completa de un bigatom en una cadena

Comments:

Returns the complete representation of a string bigatom

ba_print

include bigatom.e 
namespace bigatom 
export procedure ba_print(integer file, bigatom N) 

Escribe la representaci?n completa de un bigatom en un archivo (1 = STDOUT, 2 = STDERR)

Comments:

Enter the complete representation of a file bigatom

ba_sprintf

include bigatom.e 
namespace bigatom 
export function ba_sprintf(sequence fmt, bigatom N) 

Devuelve una cadena con la representaci?n con formato de un bigatom Nota: Necesita una revisi?n a fondo, est? hecha sobre la marcha pero es funcional. Ser?a bueno integrarla con otros tipos, substituir los bigatoms y pasarle todo a printf o sprintf. En realidad esta funci?n solo lee la cadena de formato y llama a to_string() que es quien realiza la conversi?n del n?mero y ?sta ajusta al tama?o, pone el relleno.

La cadena de formato est? formada por tres partes: la cabecera (el texto que va delante del n?mero), el propio formato y la cola (el texto que se pondr? detr?s). Todas opcionales.

Si la cadena es nula, se representar? el n?mero con todos sus d?gitos. Si no, el formato se se delimita con la pareja de caracteres '%' y 'B'. La parte anterior y posterior al formato se a?aden delante y detr?s respectivamente. Si no contiene un formato %B, la cadena se coloca delante del n?mero.

Es similar a printf(), las diferencias son: - El tama?o se refiere solo a la parte entera, no al total. Si delante del tama?o hay un car?cter que no sea un d?gito entre 1 y 9 o el signo, se toma como car?cter de relleno para completar la parte entera.

- Si detr?s del punto hay un cero, se pondr? el signo si el n?mero no es cero, pero s? en la representaci?n.

- Si el formato finaliza en 'a' se rellenan con ceros las posiciones decimales no ocupadas. Si finaliza en 'c' se utilizan espacios pero si va precedido de un car?cter que no sea un d?gito, se utiliza ?ste para rellenar las posiciones decimales.

'a' y 'c' se usan principalmente para producir salidas encolumnadas. 'c' aumenta notablemente la legibilidad al poner solo los decimales necesarios. Si no se especifica un tama?o 'c' es ignorado. No as? 'a'.

fmt = '%' ['+'] [fchar] [size] [['.'] ['0'] [decs] ['a' | [char] 'c'] ['e'|'E'] ] 'B'

[+] poner signo siempre (*)

[fchar] car?cter de relleno (cualquiera excepto d?gitos del 1 al 9, s? el 0)

[size] tama?o m?nimo de la parte entera del n?mero (si no cabe es ignorado)

[.] un punto, tan solo separa las partes de la cadena de formato

[0] poner signo cuando el n?mero es menor que los l?mites de representaci?n pero no cero en la escala actual, resultando ceros con signo

[decs] el n?mero "m?ximo" de decimales a mostrar (si es negativo, todos los decimales)

[a|[char]c] 'a': rellenar con ceros las posiciones decimales no ocupadas. 'c': usa el car?cter que le precede (si no es un d?gito), o un espacio como car?cter de relleno para la parte decimal. Si no se ha especificado un tama?o 'c' es ignorado. ['E' | 'e'] formato exponencial, escribe el n?mero en formato exponencial, con 'e' o 'E' el uso de 'a' es redundante y 'c' es ignorado, siempre rellena con ceros.

Cuando el car?cter de relleno es '0' se reserva la primera posici?n para el signo.

(*) El signo de cero (un espacio) solo se muestra cuando el car?cter de relleno es '0' y el signo se coloca delante del relleno y no detr?s como en los dem?s casos.

Comments:

Returns a string representation formatted as a bigatom - Note: You need a major overhaul, is made on the fly but is functional. - It would be nice to integrate with other types, replace bigatoms and pass all - Printf or sprintf. Actually this function only reads the format string and - Calls to_string () that is executed by converting the number and it fits - The size, the filling places.

The format string consists of three parts: the header (the text that goes before - The number), the format itself and tail (the text to be put back). All optional.

If the string is null, the number with all digits will be represented. Otherwise, the format - Is delimited with the two characters '%' and 'B'. The front and back of the format - Front and rear are added respectively. If it contains a format% B, the string is placed - Before the number.

It is similar to printf (), the differences are: - - The size refers only to the integer part, not the total. If there is a front size - Character other than a digit between 1 and 9 or the sign is taken as filler character - To complete the whole part.

- - If there is a scratch behind the point, the sign will be if the number is not zero, but in - Representation. - - - If the format ends in 'a' are filled with zeros decimal places unoccupied. - If ending in 'c' spaces are used but if it is preceded by a character other than - A digit, it is used to fill the decimal places. - - 'A' and 'c' is mainly used to produce encolumnadas outputs. - 'C' markedly increased readability by making only the necessary decimals. If not - Specify a size 'c' is ignored. Not so 'a'.

Fmt = '%' ['+'] [fchar] [size] [char] 'c'] ['e' | 'E'. ''' B ' - - [+] Sign always put (*) - - [Fchar] symbol (excluding any digit from 1 to 9, if the 0) - - [Size] minimum size of the integer part of the number (if it can not be ignored) - - [.] Point, separates only the parts of the format string - - [0] put sign when the number is less than the limits of representation but - Not zero at the current scale, leading zeros with sign - - [Decs] "maximum" number of decimal places to display (if negative, all decimal) - - [A | [char] c] 'a': filled with zeros decimal places unoccupied. - 'C': use the character that precedes it (if not a digit), or a space as - Fill character for the decimal part. If you have not specified a - Size 'c' is ignored. - ['E' | 'e'] exponential format, type the number in exponential format with 'e' or 'E' - The use of 'a' is redundant and 'c' is ignored, always filled with zeros. - - When the filler is '0' retains the top spot for the sign. - - (*) The sign of zero (space) is only displayed when the pad character is '0' and - The sign is placed in front of the filling and not behind as in other cases.


part 4

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu